{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "import glob\n",
    "\n",
    "def resize_img(image_path, size):\n",
    "    img = cv2.imread(image_path)\n",
    "    img = cv2.resize(img,(size,size), interpolation = cv2.INTER_CUBIC)\n",
    "    cv2.imwrite(image_path,img)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "target_folder = './images/256/'\n",
    "train_img = glob.glob(target_folder + 'train/*/*/*')\n",
    "val_img = glob.glob(target_folder + 'val/*/*')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# target_folder = './299/'\n",
    "# train_img = glob.glob(target_folder + 'train/*/*/*')\n",
    "# val_img = glob.glob(target_folder + 'val/*/*')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "for image in val_img:\n",
    "    resize_img(image,256)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "for image in train_img:\n",
    "    resize_img(image,256)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "target_folder = './NTAT/PNG/*.png'\n",
    "imgs = glob.glob(target_folder)\n",
    "for img in imgs:\n",
    "    resize_img(img, 299)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
